home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 76 / MF_UK_76_1.iso / Education Feature / MicroWorlds 2.03 Try Me / MicroWorlds 2.03 Try Me.rsrc / TEXT_560_distance.txt < prev    next >
Encoding:
Text File  |  1998-05-08  |  413 b   |  20 lines

  1. distance turtle-name
  2.  
  3. Reports the distance between the current turtle and the turtle indicated.
  4.  
  5. Example: 
  6.  
  7. In this example, there are two turtles on the page.
  8.  
  9. t1, 
  10. show distance "t2
  11. 122    Your answer will be different.
  12. towards "t2
  13. fd distance "t2      T1 meets t2.
  14.  
  15. Set t1 to go Many Times and define the go procedure as follows. T1 will be "trapped" around t2:
  16.  
  17. to go
  18. fd 1
  19. if 100 < distance "t2 [towards "t2]
  20. end